import java.util.Scanner;

public abstract class User {
    private String userId;//用户id
    private String userName;
    private String userPassword;//密码
    private String phone;//手机号
    private String registerTime;//注册时间
    private String userType;
    public User(String userID,String userName,String userPassword,String registerTime,String phone,String userType){
        this.userId=userID;
        this.userName=userName;
        this.userType=userType;
        this.userPassword=userPassword;
        this.phone=phone;
        this.registerTime=registerTime;
    }
    public String getUserId(){
        return userId;
    }
    public String getPhone(){
        return phone;
    }
    public String getUserPassword(){
        return userPassword;
    }
    public String getUserName(){
        return userName;
    }
    public String getRegisterTime(){
        return registerTime;
    }
    public String getUserType(){
        return userType;
    }
    public void setPhone(String phone){
        this.phone=phone;
    }
    //更改密码需要验证原先旧密码
    public void setUserPassword(String oldPassword,String newPassword){
        if(this.userPassword.equals(oldPassword)){
            this.userPassword=newPassword;
        }
    }
    //管理员可以重置密码
    public void setUserPassword(String initialPassword){
        this.userPassword=initialPassword;
    }
    public void setUserName(String userName){
        this.userName=userName;
    }
    public void setRegisterTime(String registerTime){
        this.registerTime=registerTime;
    }
    public void setUserType(String userType){
        this.userType=userType;
    }
    public void setUserID(String userID){
        this.userId=userID;
    }
    //登录
    public abstract void login();
    //退出
    public abstract void exit();
    public abstract void show();
}
